<?php

//qoo welcome application

require('init.php');

try {
$fc = new \qoo\controller\FrontController();
$view = new \qoo\controller\View();
$view->setView('default');
$fc->dispatcher->setControllerParameters( array('view' => $view) );


$fc->router->createRoute('index')
				->map('')
				->setParam('controller','DefaultController')
				->setParam('action' , 'index');

$fc->router->createRoute('forced_error')
				->map('/error')
				->setParam('controller','DefaultController')
				->setParam('action' , 'testError');
				
				
$fc->router->createRoute('forward')
				->map('/forward')
				->setParam('controller','DefaultController')
				->setParam('action' , 'testForward');
				
				
$fc->router->createRoute('404')
				->map('/404')
				->setParam('controller','DefaultController')
				->setParam('action' , '_404');				
				
				
$fc->router->createRoute('forced_exception')
				->map('/exception')
				->setParam('controller','DefaultController')
				->setParam('action' , 'testException');							
										
$fc->router->createRoute('parameter_test')
				->map('/hello/{name}/')
				->setParam('controller','DefaultController')
				->setParam('action' , 'testParameter');							
										


$fc->dispatch();



} catch (\qoo\core\Exception   $e)
{
	$handler = new \qoo\core\ExceptionHandler();
	$handler->printHtmlReport($e);
}
?>